package cn.gson.crm.model.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

/**
 * 回款明细实体类
 * 
 * @author hzl
 * @date 2018年4月8日
 * @time 下午8:45:47
 */
@Entity
@Table(name = "crm_receivable_detail")
public class ReceivableDetail {
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;
	/**
	 * 期数
	 */
	private int installment;
	/**
	 * 计划回款时间
	 */
	@Column(name = "plan_time")
	private Date planTime;
	/**
	 * 实际回款时间
	 */
	@Column(name = "actual_time")
	private Date actualTime;
	/**
	 * 回款状态
	 */
	private boolean state;
	/**
	 * 实际回款金额
	 */
	@Column(name = "actual_money")
	private double actuaMoney;
	/**
	 * 计划回款金额
	 */
	@Column(name = "plan_money")
	private double planMoney;
	/**
	 * 所有者
	 */
	@ManyToOne
	private Employee employee;
	/**
	 * 对应回款
	 */
	@ManyToOne
	private Receivable receivable;
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public int getInstallment() {
		return installment;
	}
	public void setInstallment(int installment) {
		this.installment = installment;
	}
	public Date getPlanTime() {
		return planTime;
	}
	public void setPlanTime(Date planTime) {
		this.planTime = planTime;
	}
	public Date getActualTime() {
		return actualTime;
	}
	public void setActualTime(Date actualTime) {
		this.actualTime = actualTime;
	}
	public boolean isState() {
		return state;
	}
	public void setState(boolean state) {
		this.state = state;
	}
	public double getActuaMoney() {
		return actuaMoney;
	}
	public void setActuaMoney(double actuaMoney) {
		this.actuaMoney = actuaMoney;
	}
	public double getPlanMoney() {
		return planMoney;
	}
	public void setPlanMoney(double planMoney) {
		this.planMoney = planMoney;
	}
	public Employee getEmployee() {
		return employee;
	}
	public void setEmployee(Employee employee) {
		this.employee = employee;
	}
	public Receivable getReceivable() {
		return receivable;
	}
	public void setReceivable(Receivable receivable) {
		this.receivable = receivable;
	}
	public ReceivableDetail() {
		// TODO Auto-generated constructor stub
	}
	public ReceivableDetail( int installment, Date planTime, Date actualTime, boolean state, double actuaMoney,
			double planMoney, Employee employee, Receivable receivable) {
		super();
		this.installment = installment;
		this.planTime = planTime;
		this.actualTime = actualTime;
		this.state = state;
		this.actuaMoney = actuaMoney;
		this.planMoney = planMoney;
		this.employee = employee;
		this.receivable = receivable;
	}
	@Override
	public String toString() {
		return "ReceivableDetail [id=" + id + ", installment=" + installment + ", planTime=" + planTime
				+ ", actualTime=" + actualTime + ", state=" + state + ", actuaMoney=" + actuaMoney + ", planMoney="
				+ planMoney + "]";
	}
	
}
